/* *****************************************************************************
 * JFab (http://code.google.com/p/jfab)
 * Copyright (c) 2011 JFab.org
 * Admin jfab@jeffreythompson.net
 *
 * See the file "LICENSE.txt" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * *****************************************************************************/

package org.jfab.core.model;

import java.util.Map;

import org.javaruntype.type.Type;
import org.javaruntype.typedef.TypeDef;

/**
 * Defines methods required by a type factory.
 */
public interface TypeFactory
{
    /**
     * @param aClass Class.
     * 
     * @return a new type.
     */
    Type<?> createType(Class<?> aClass);

    /**
     * @param importMap Map of simple type name to type.
     * @param className Class name.
     * 
     * @return a new type.
     */
    Type<?> createType(Map<String, Type<?>> importMap, String className);

    /**
     * @param codeFragment Code fragment.
     * 
     * @return a new type.
     */
    Type<?> createType(String codeFragment);

    /**
     * @param packageName Package name.
     * @param importMap Map of simple type name to type.
     * @param className Class name.
     * 
     * @return a new type.
     */
    Type<?> createType(String packageName, Map<String, Type<?>> importMap,
            String className);

    /**
     * @param aClass Class.
     * 
     * @return a new type definition.
     */
    TypeDef createTypeDef(Class<?> aClass);

    /**
     * @param codeFragment Code fragment.
     * 
     * @return a new type definition.
     */
    TypeDef createTypeDef(String codeFragment);
}
